export default data => {
  const methodRef = ref(null)

  const register = methods => {
    methodRef.value = methods
    methodRef.value.initData(data)
  }

  const testMethod = val => {
    methodRef.value.testMethod(val)
  }

  const reload = () => {
    methodRef.value.reload()
  }

  return [register, { testMethod, reload }]
}
